Imports Cadcorp.SIS.GisLink.Library Imports Cadcorp.SIS.GisLink.Library.Constants Imports System.Windows.Forms _ Public Class HelloWorld Public Shared APP As SisApplication Private Shared _sis As Cadcorp.SIS.GisLink.Library.Desktop Public Shared Property SIS As Cadcorp.SIS.GisLink.Library.Desktop Get If _sis Is Nothing Then _sis = APP.TakeoverManager Return _sis End Get Set(ByVal value As Cadcorp.SIS.GisLink.Library.Desktop) _sis = value End Set End Property Public Sub New(ByVal SISApplication As SisApplication) APP = SISApplication ' This is the application group in Cadcorp SIS desktop Applications Tab Dim group As SisRibbonGroup = APP.RibbonGroup group.Text = "HelloGislink" ' Define a large command button Dim BigButton As SisRibbonButton = New SisRibbonButton("Big Button", New SisClickHandler(AddressOf AddSomeData)) BigButton.LargeImage = True BigButton.Help = "Help Text" BigButton.Description = "Descriptive Text" ' Add the button to the main add-in group group.Controls.Add(BigButton) Dim DropDownButton As SisRibbonButton = New SisRibbonButton("Drop Down") DropDownButton.LargeImage = True Dim ChildButton1 As SisRibbonButton = New SisRibbonButton("Child Button 1", New SisClickHandler(AddressOf ExportImages)) ChildButton1.LargeImage = True DropDownButton.SubItems.Add(ChildButton1) group.Controls.Add(DropDownButton) ' A container for a group of small buttons Dim smallGroup1 As SisRibbonControlGroup = New SisRibbonControlGroup ' Populate the first small button group Dim SmallButton1 As SisRibbonButton = New SisRibbonButton("My Small Button") SmallButton1.Help = "Help Text" SmallButton1.Description = "Descriptive Text" smallGroup1.Controls.Add(SmallButton1) Dim SmallButton2 As SisRibbonButton = New SisRibbonButton("My Small Button") SmallButton2.Help = "Help Text" SmallButton2.Description = "Descriptive Text" smallGroup1.Controls.Add(SmallButton2) Dim SmallButton3 As SisRibbonButton = New SisRibbonButton("My Small Button") SmallButton3.Help = "Help Text" SmallButton3.Description = "Descriptive Text" smallGroup1.Controls.Add(SmallButton3) ' Add the button group to the main add-in group group.Controls.Add(smallGroup1) End Sub Private Sub AddSomeData(ByVal sender As Object, ByVal e As SisClickArgs) 'make an object from e.Desktop SIS = e.Desktop Try 'the first parameter provides a file path the second determines if the swd is 'is loaded as a editable or read only. 0 = editable 1 = read-only SIS.SwdOpen("C:\TestSWD\World Countries.swd", 0) Catch ex As Exception End Try 'release SIS Control SIS.Dispose() SIS = Nothing End Sub Private Sub ExportImages(ByVal sender As Object, ByVal e As SisClickArgs) SIS = e.Desktop Try ' file path, resolution of the output image SIS.ExportGif("c:\TestSWD\map.gif", 600, 400) SIS.ExportPng("c:\TestSWD\mapb.png", 1024, 1024) SIS.ExportJpeg("c:\TestSWD\mapd.jpg", 1024, 1024) Catch ex As Exception End Try SIS.Dispose() SIS = Nothing End Sub End Class